package twentyThreePattern.StructuralPattern7.proxy.DynamicProxy.section3;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler {
	Object target = null;

	public MyInvocationHandler(Object obj) {
		this.target = obj;
	}

	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

		Object result = null;

		result = method.invoke(target, args);
		// 后置通知的触发条件
		if (true) {
			new AfterAdvice().exec();
		}

		return result;

	}

}
